package cn.itcast.shiro;

import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.credential.HashedCredentialsMatcher;

public class RetryLimitHashedCredentialsMatcher extends CustomCredentialsMatcher {
    @Override
    public boolean doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info) {

        EasyTypeToken tk = (EasyTypeToken) token;
        if (tk.getType().equals(LoginType.NOPASSWD)) {
            return true;
        }
        return super.doCredentialsMatch(token, info);
    }
}
